/* ============================================================
   CarZoon Browse Cars Page — v3
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

.czb-wrap {
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    align-items: start;
}

.czb-main   { order: 1; }
.czb-sidebar { order: 2; position: sticky; top: 80px; }

/* ── TOP BAR ── */
.czb-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.czb-browse-title {
    font-size: 28px;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
    font-style: italic;
}
.czb-topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.czb-sort-form    { display: flex; align-items: center; gap: 10px; }
.czb-sort-label   { font-size: 12px; font-weight: 700; color: #64748b; letter-spacing: 0.5px; white-space: nowrap; }
.czb-sort-select {
    border: 1.5px solid #d1d9e8; border-radius: 10px; padding: 8px 32px 8px 12px;
    font-size: 13px; font-weight: 600; color: #0f172a; background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}
.czb-view-toggle { display: flex; border: 1.5px solid #d1d9e8; border-radius: 10px; overflow: hidden; }
.czb-view-btn {
    background: transparent; border: none; padding: 8px 12px;
    font-size: 16px; cursor: pointer; color: #94a3b8; transition: 0.15s;
}
.czb-view-btn:hover, .czb-view-active { background: #0f2744; color: #fff; }

/* ── RESULTS BAR ── */
.czb-results-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px; padding-bottom: 12px;
    border-bottom: 2px solid #e8edf8;
}
.czb-results-count { font-size: 14px; color: #64748b; font-weight: 600; }
.czb-clear-filters { font-size: 13px; color: #2f68ff; text-decoration: none; font-weight: 600; }
.czb-clear-filters:hover { text-decoration: underline; }

/* ── GRID ── */
.czb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

/* List view */
.czb-grid.czb-list-view {
    grid-template-columns: 1fr;
}
.czb-list-view .czb-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    border-radius: 16px;
}
.czb-list-view .czb-card-img-wrap {
    aspect-ratio: auto;
    min-height: 140px;
    border-radius: 16px 0 0 16px;
}
.czb-list-view .czb-card-body { padding: 18px 20px; }

/* ── CAR CARD ── */
.czb-card {
    background: #fff;
    border: 1.5px solid #e8edf8;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: block;
}
.czb-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(15,39,68,0.12);
    border-color: #2f68ff;
}

.czb-card-img-wrap {
    position: relative;
    aspect-ratio: 16/10;
    background: #f0f4f8;
    overflow: hidden;
}
.czb-card-img {
    width: 100%; height: 100%; object-fit: cover;
    display: block; transition: transform 0.3s;
}
.czb-card:hover .czb-card-img { transform: scale(1.04); }
.czb-card-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; color: #c4d0e3;
}
.czb-card-price {
    position: absolute; bottom: 12px; right: 12px;
    background: #2f68ff; color: #fff;
    font-size: 16px; font-weight: 800;
    padding: 6px 14px; border-radius: 10px;
    box-shadow: 0 4px 12px rgba(47,104,255,0.3);
}
.czb-card-reg {
    position: absolute; top: 10px; left: 10px;
    background: #ffd84c; border: 2px solid #f0b800;
    border-radius: 8px; padding: 3px 10px;
    font-size: 11px; font-weight: 800;
    color: #111; letter-spacing: 1.5px; text-transform: uppercase;
}
.czb-card-condition {
    position: absolute; top: 10px; right: 10px;
    background: #0f2744; color: #fff;
    border-radius: 7px; padding: 3px 10px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
}

.czb-card-body { padding: 16px; }
.czb-card-title {
    font-size: 14px; font-weight: 800; color: #0f172a;
    margin: 0 0 10px; line-height: 1.3;
    text-transform: uppercase;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.czb-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.czb-tag {
    font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 6px;
    background: #f1f5f9; color: #475569;
}
.czb-tag-make { background: #eff6ff; color: #2f68ff; }
.czb-tag-year { background: #f0fdf4; color: #059669; }
.czb-card-mileage, .czb-card-location {
    font-size: 12px; color: #7b91b0;
    margin-top: 5px;
}

/* ── NO RESULTS ── */
.czb-no-results { grid-column: 1 / -1; text-align: center; padding: 60px 20px; }
.czb-no-results-icon { font-size: 56px; opacity: 0.2; margin-bottom: 16px; }
.czb-no-results h3 { color: #334155; margin-bottom: 8px; }
.czb-no-results p  { color: #94a3b8; }
.czb-no-results a  { color: #2f68ff; font-weight: 600; }

/* ── PAGINATION ── */
.czb-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.czb-page-btn {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1.5px solid #e2e8f0;
    font-size: 14px; font-weight: 700; color: #0f2744;
    text-decoration: none; transition: 0.15s;
}
.czb-page-btn:hover { border-color: #2f68ff; color: #2f68ff; }
.czb-page-active { background: #2f68ff !important; color: #fff !important; border-color: #2f68ff !important; }

/* ── SIDEBAR ── */
.czb-sidebar-card {
    background: #0f2744;
    overflow: hidden;
}
.czb-sidebar-head {
    padding: 26px 22px 10px;
    display: flex; align-items: center; gap: 14px;
}
.czb-sidebar-icon  { font-size: 30px; }
.czb-sidebar-title { font-size: 21px; font-weight: 900; color: #fff; margin: 0; line-height: 1.2; }
.czb-filter-form   { padding: 8px 18px 22px; }

.czb-filter-field { margin-bottom: 10px; position: relative; }

.czb-filter-select, .czb-filter-text {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    opacity: 1;
    visibility: visible;
    background: rgba(255,255,255,0.08);
    outline: none;
    transition: border-color 0.18s;
    font-family: inherit;
}
.czb-filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: rgba(255,255,255,0.08);
    cursor: pointer;
    padding-right: 36px;
}
.czb-filter-select option { background: #1e3a5f; color: #fff; }
.czb-filter-text::placeholder { color: rgba(255,255,255,0.45); }
.czb-filter-select:focus, .czb-filter-text:focus { border-color: rgba(255,255,255,0.45); }

.czb-filter-location { display: flex; align-items: center; }
.czb-loc-icon { position: absolute; left: 12px; font-size: 15px; pointer-events: none; }
.czb-filter-location .czb-filter-text { padding-left: 32px; }

/* ── RANGE SLIDER ── */
.czb-filter-range-wrap { margin-bottom: 14px; }
.czb-filter-range-label {
    font-size: 11px; font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase; letter-spacing: 0.6px;
    margin-bottom: 10px;
}
.czb-range-slider {
    position: relative;
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    margin: 14px 6px;
}
.czb-range-fill {
    position: absolute;
    height: 100%;
    background: #fff;
    border-radius: 3px;
    pointer-events: none;
}
.czb-range-input {
    position: absolute;
    width: 100%; height: 100%; top: 0; left: 0;
    opacity: 0; cursor: pointer; margin: 0;
    pointer-events: all;
}
.czb-range-input.czb-range-low  { z-index: 3; }
.czb-range-input.czb-range-high { z-index: 4; }
.czb-range-thumb {
    position: absolute;
    width: 16px; height: 16px;
    background: #fff; border: 2.5px solid #2f68ff;
    border-radius: 50%;
    top: 50%; transform: translate(-50%, -50%);
    pointer-events: none; z-index: 2;
}
.czb-range-values {
    display: flex; gap: 8px; margin-top: 10px;
}
.czb-range-val-input {
    flex: 1; text-align: center;
    background: rgba(255,255,255,0.09);
    border: 1.5px solid rgba(255,255,255,0.13);
    border-radius: 8px; padding: 6px 8px;
    font-size: 12px; font-weight: 700; color: #fff;
    font-family: inherit; outline: none;
}
.czb-price-vals { justify-content: space-between; }
.czb-range-val-display {
    flex: 1; text-align: center;
    background: rgba(255,255,255,0.09);
    border: 1.5px solid rgba(255,255,255,0.13);
    border-radius: 8px; padding: 6px 8px;
    font-size: 12px; font-weight: 700; color: #fff;
}

/* ── DIVIDER / KEYWORD ── */
.czb-filter-divider {
    font-size: 11px; font-weight: 700;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.5px; text-transform: uppercase;
    margin: 14px 0 10px;
}

/* ── ACTIONS ── */
.czb-filter-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.czb-filter-btn-search {
    width: 100%; padding: 13px; background: #fff; color: #0f2744 !important;
    border: none; border-radius: 12px; font-size: 14px; font-weight: 800;
    cursor: pointer; letter-spacing: 0.5px; transition: 0.18s; font-family: inherit;
}
.czb-filter-btn-search:hover { background: #f0f5ff; }
.czb-filter-btn-reset {
    display: block; text-align: center; width: 100%; padding: 11px;
    background: transparent; border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 12px; font-size: 13px; font-weight: 700;
    color: rgba(255,255,255,0.8); text-decoration: none; transition: 0.18s;
}
.czb-filter-btn-reset:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .czb-wrap { grid-template-columns: 1fr; }
    .czb-sidebar { order: -1; position: static; }
}
@media (max-width: 900px) {
    .czb-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .czb-grid { grid-template-columns: 1fr; }
    .czb-wrap { padding: 16px 12px; }
    .czb-list-view .czb-card { grid-template-columns: 1fr; }
    .czb-list-view .czb-card-img-wrap { border-radius: 16px 16px 0 0; aspect-ratio: 16/9; }
}


/* ============================
   MOBILE SIDEBAR DRAWER
   ============================ */

@media (max-width: 1024px) {

    .czb-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100%;
        z-index: 9999;
        background: #0f2744;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding-top: 20px;
    }

    .czb-sidebar.active {
        left: 0;
    }

    /* overlay */
    .czb-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
    }

    .czb-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* button style */
    .czb-filter-toggle-btn {
        display: inline-block;
        background: #0f2744;
        color: #fff;
        border: none;
        padding: 10px 14px;
        border-radius: 10px;
        font-weight: 700;
        cursor: pointer;
    }
}

/* Hide button on desktop */
@media (min-width: 1025px) {
    .czb-filter-toggle-btn {
        display: none;
    }
}
/* ── SELLER TYPE TABS (Browse page) ── */
.czb-seller-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.czb-seller-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: all 0.18s;
}
.czb-seller-tab:hover { background: #e2e8f4; color: #0f2744; }
.czb-seller-tab.is-active {
    background: #0f2744;
    color: #fff;
    border-color: #0f2744;
}
